<!DOCTYPE html>
<html lang="en" >
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>开始使用 layui</title>
    <link rel="stylesheet" href="./layui/css/layui.css" >

</head>
<body>


<table  class="layui-hide" id="demotable" >

</table>
<script src="./layui/layui.js"></script>
<script >
    layui.use('table', function(){
        var table = layui.table;
        //展示异步数据
        table.render({
            elem: '#demotable'
            ,url: '/hellouser_json'
            //,skin: 'line' //表格风格
            ,even: true
            ,page: true //是否显示分页
            ,cols: [
                [ //标题栏
                    {field: 'id', title: 'id'}
                    ,{field: 'username', title: '用户名称'}
                    ,{field: 'password', title: '用户密码'}
                ]
            ]
            ,limit: 10   //默认值
            ,limits: [1, 5, 10] //设置每页显示几条
        });
    });
</script>
</body>
</html>